This analysis examines the economic trajectory of Hungary compared to its seven direct neighbors from 2010 through the most recent available data, focusing on key World Bank Development Indicators (WDI).
Period: 2010–Present (focusing on yearly data points)
Key Events: - Post-Global Financial Crisis recovery (2010-2013) - EU integration/Eurozone issues - COVID-19 pandemic response (2020-2022)
Target Countries (N=8): Hungary, Austria, Slovakia, Ukraine, Romania, Serbia, Croatia, Slovenia
Data Source: World Bank Development Indicators (WDI)
# Define countries
countries <- c("HUN", "AUT", "SVK", "UKR", "ROU", "SRB", "HRV", "SVN")
country_names <- c("Hungary", "Austria", "Slovakia", "Ukraine", "Romania", "Serbia", "Croatia", "Slovenia")
# Define indicators with names
indicators_list <- list(
"NY.GDP.PCAP.PP.CD" = "GDP per capita, PPP",
"NY.GDP.MKTP.KD.ZG" = "GDP Growth",
"FP.CPI.TOTL.ZG" = "Inflation",
"GC.DOD.TOTL.GD.ZS" = "Central Government Debt (Total Debt)",
"BX.KLT.DINV.WD.GD.ZS" = "FDI net inflows",
"SL.UEM.TOTL.ZS" = "Unemployment"
)
# Fetch data from World Bank - fetch each indicator separately to handle errors
wb_data_list <- list()
for (ind in names(indicators_list)) {
tryCatch({
temp_data <- wb_data(
indicator = ind,
country = countries,
start_date = 2010,
end_date = 2024
)
wb_data_list[[ind]] <- temp_data
cat("Successfully fetched:", ind, "\n")
}, error = function(e) {
cat("Failed to fetch:", ind, "\n", conditionMessage(e), "\n")
})
}
## Successfully fetched: NY.GDP.PCAP.PP.CD
## Successfully fetched: NY.GDP.MKTP.KD.ZG
## Successfully fetched: FP.CPI.TOTL.ZG
## Successfully fetched: GC.DOD.TOTL.GD.ZS
## Successfully fetched: BX.KLT.DINV.WD.GD.ZS
## Successfully fetched: SL.UEM.TOTL.ZS
# Combine all data
wb_data <- bind_rows(wb_data_list)
# Check what columns we have
if (nrow(wb_data) > 0) {
cat("Columns in wb_data:", paste(names(wb_data), collapse = ", "), "\n")
}
## Columns in wb_data: iso2c, iso3c, country, date, NY.GDP.PCAP.PP.CD, unit, obs_status, footnote, last_updated, NY.GDP.MKTP.KD.ZG, FP.CPI.TOTL.ZG, GC.DOD.TOTL.GD.ZS, BX.KLT.DINV.WD.GD.ZS, SL.UEM.TOTL.ZS
# Clean and prepare data
# The wb_data function returns: iso2c, iso3c, country, date, and the indicator value columns
wb_data_clean <- wb_data %>%
mutate(year = as.numeric(date)) %>%
pivot_longer(
cols = all_of(names(indicators_list)),
names_to = "indicator_id",
values_to = "value"
) %>%
filter(!is.na(value))
Analysis Focus: Convergence/Divergence. How did Hungary’s standard of living, adjusted for purchasing power, track compared to the high-income benchmark (Austria) and the Central/Eastern European (CEE) neighbors over time?
# Filter GDP per capita data
gdp_pc <- wb_data_clean %>%
filter(indicator_id == "NY.GDP.PCAP.PP.CD") %>%
drop_na(value)
# Create line plot
ggplot(gdp_pc, aes(x = year, y = value, color = country, group = country)) +
geom_line(size = 1.2) +
geom_point(size = 2) +
scale_y_continuous(labels = scales::dollar_format()) +
labs(
title = "GDP per Capita, PPP (Current International $)",
subtitle = "2010-Present",
x = "Year",
y = "GDP per capita (PPP)",
color = "Country"
) +
theme_minimal(base_size = 12) +
theme(legend.position = "right")
# Summary statistics table
gdp_pc_summary <- gdp_pc %>%
group_by(country) %>%
summarize(
`2010` = first(value[year == 2010], default = NA),
`Most Recent` = last(value),
`Average` = mean(value, na.rm = TRUE),
`Growth %` = ((last(value) - first(value)) / first(value)) * 100
) %>%
arrange(desc(`Most Recent`))
kable(gdp_pc_summary,
digits = 0,
format.args = list(big.mark = ","),
caption = "GDP per Capita Summary Statistics") %>%
kable_styling(bootstrap_options = c("striped", "hover", "condensed"))
| country | 2010 | Most Recent | Average | Growth % |
|---|---|---|---|---|
| Austria | 41,740 | 71,618 | 55,673 | 72 |
| Slovenia | 27,582 | 56,531 | 38,442 | 105 |
| Romania | 17,357 | 48,712 | 29,387 | 181 |
| Croatia | 20,144 | 48,575 | 30,205 | 141 |
| Hungary | 21,693 | 47,636 | 32,167 | 120 |
| Slovak Republic | 25,384 | 47,181 | 33,164 | 86 |
| Serbia | 13,322 | 31,867 | 19,486 | 139 |
| Ukraine | 8,453 | 18,550 | 12,800 | 119 |
# Calculate Hungary's performance
hungary_gdp <- gdp_pc %>% filter(country == "Hungary")
hungary_2010 <- hungary_gdp %>% filter(year == 2010) %>% pull(value)
hungary_recent <- hungary_gdp %>% filter(year == max(year)) %>% pull(value)
hungary_growth_pct <- ((hungary_recent - hungary_2010) / hungary_2010) * 100
# Regional average (excluding Austria)
regional_avg <- gdp_pc %>%
filter(country != "Austria") %>%
group_by(year) %>%
summarize(avg_gdp = mean(value, na.rm = TRUE))
# Create comparison chart
gdp_pc_with_avg <- gdp_pc %>%
left_join(regional_avg, by = "year")
ggplot() +
geom_line(data = gdp_pc_with_avg %>% filter(country != "Austria"),
aes(x = year, y = value, color = country, group = country), size = 0.8, alpha = 0.6) +
geom_line(data = regional_avg, aes(x = year, y = avg_gdp),
color = "black", size = 1.5, linetype = "dashed") +
geom_line(data = gdp_pc_with_avg %>% filter(country == "Hungary"),
aes(x = year, y = value), color = "red", size = 1.5) +
annotate("text", x = 2020, y = regional_avg %>% filter(year == 2020) %>% pull(avg_gdp),
label = "Regional Avg", vjust = -1, fontface = "bold") +
annotate("text", x = 2020, y = hungary_gdp %>% filter(year == 2020) %>% pull(value),
label = "HUNGARY", vjust = -1, color = "red", fontface = "bold") +
scale_y_continuous(labels = scales::dollar_format()) +
labs(
title = "Hungary's GDP per Capita vs. Regional Average (CEE)",
subtitle = "Hungary highlighted in red, Regional average (excluding Austria) in dashed black",
x = "Year",
y = "GDP per capita (PPP)",
color = "Country"
) +
theme_minimal(base_size = 12)
Key Insights:
Overall Growth: Hungary’s GDP per capita (PPP) grew by 119.6% from 2010 to the most recent year, moving from $21,693.4 to $47,635.9.
Regional Positioning: Hungary’s performance relative to its CEE neighbors shows a consistent upward trajectory, though it remains in the middle tier among the comparison countries.
Convergence Dynamics: While all CEE countries show convergence toward Austrian living standards, the pace varies significantly. Hungary’s convergence has been steady but not exceptional compared to high-performers like Slovakia and Slovenia.
# Calculate year-over-year changes in GDP per capita
gdp_pc_changes <- gdp_pc %>%
arrange(country, year) %>%
group_by(country) %>%
mutate(
gdp_change = value - lag(value),
gdp_change_pct = (gdp_change / lag(value)) * 100
) %>%
filter(!is.na(gdp_change))
# Bar chart of average annual growth
avg_annual_growth <- gdp_pc_changes %>%
group_by(country) %>%
summarize(avg_annual_growth = mean(gdp_change_pct, na.rm = TRUE)) %>%
arrange(desc(avg_annual_growth))
ggplot(avg_annual_growth, aes(x = reorder(country, avg_annual_growth), y = avg_annual_growth,
fill = ifelse(country == "Hungary", "Hungary", "Other"))) +
geom_bar(stat = "identity") +
coord_flip() +
scale_fill_manual(values = c("Hungary" = "red", "Other" = "steelblue")) +
labs(
title = "Average Annual Growth in GDP per Capita (PPP)",
subtitle = "2010-Present",
x = "",
y = "Average Annual Growth (%)",
fill = ""
) +
theme_minimal(base_size = 12) +
theme(legend.position = "none")
Analysis Focus: Resilience and Catch-up. Average annual growth rate (2010-Present) to assess long-term momentum. Analysis of peak performance years and recession years.
# Filter GDP growth data
gdp_growth <- wb_data_clean %>%
filter(indicator_id == "NY.GDP.MKTP.KD.ZG") %>%
drop_na(value)
# Create line plot
ggplot(gdp_growth, aes(x = year, y = value, color = country, group = country)) +
geom_line(size = 1.2) +
geom_point(size = 2) +
geom_hline(yintercept = 0, linetype = "dashed", color = "black") +
labs(
title = "GDP Growth (Annual %)",
subtitle = "2010-Present - Note: 2020 COVID-19 impact",
x = "Year",
y = "GDP Growth (%)",
color = "Country"
) +
theme_minimal(base_size = 12) +
theme(legend.position = "right")
# Summary statistics
gdp_growth_summary <- gdp_growth %>%
group_by(country) %>%
summarize(
`Avg Growth` = mean(value, na.rm = TRUE),
`Min Growth` = min(value, na.rm = TRUE),
`Max Growth` = max(value, na.rm = TRUE),
`SD` = sd(value, na.rm = TRUE)
) %>%
arrange(desc(`Avg Growth`))
kable(gdp_growth_summary,
digits = 2,
caption = "GDP Growth Summary Statistics") %>%
kable_styling(bootstrap_options = c("striped", "hover", "condensed"))
| country | Avg Growth | Min Growth | Max Growth | SD |
|---|---|---|---|---|
| Romania | 2.68 | -3.91 | 8.20 | 3.31 |
| Slovak Republic | 2.56 | -2.59 | 6.79 | 2.29 |
| Hungary | 2.38 | -4.34 | 7.22 | 3.03 |
| Serbia | 2.22 | -1.80 | 7.95 | 2.59 |
| Slovenia | 2.00 | -4.09 | 8.39 | 3.08 |
| Croatia | 1.96 | -8.31 | 12.63 | 4.65 |
| Austria | 1.16 | -6.32 | 5.28 | 2.76 |
| Ukraine | -1.28 | -28.76 | 5.53 | 9.04 |
# Identify recession years and recovery periods for Hungary
hungary_growth <- gdp_growth %>% filter(country == "Hungary")
# Calculate volatility (standard deviation) for each country
growth_volatility <- gdp_growth %>%
group_by(country) %>%
summarize(
volatility = sd(value, na.rm = TRUE),
avg_growth = mean(value, na.rm = TRUE)
) %>%
arrange(desc(volatility))
# Volatility vs Growth scatter plot
ggplot(growth_volatility, aes(x = volatility, y = avg_growth, label = country)) +
geom_point(aes(color = ifelse(country == "Hungary", "Hungary", "Other")), size = 4) +
geom_text(vjust = -0.8, hjust = 0.5, size = 3.5, fontface = "bold") +
scale_color_manual(values = c("Hungary" = "red", "Other" = "steelblue")) +
geom_vline(xintercept = mean(growth_volatility$volatility), linetype = "dashed", alpha = 0.5) +
geom_hline(yintercept = mean(growth_volatility$avg_growth), linetype = "dashed", alpha = 0.5) +
labs(
title = "GDP Growth: Risk-Return Profile",
subtitle = "Higher and to the right = High growth but volatile; Upper left = Stable high growth",
x = "Volatility (Standard Deviation)",
y = "Average Annual GDP Growth (%)"
) +
theme_minimal(base_size = 12) +
theme(legend.position = "none")
Key Insights:
Growth Volatility: Countries with higher average growth often experience greater volatility. Ukraine shows extreme volatility due to geopolitical conflicts, while Austria demonstrates stable but moderate growth.
Hungary’s Profile: Hungary exhibits moderate growth with moderate volatility, suggesting a relatively balanced economic trajectory without extreme booms or busts.
Pre-COVID vs. Post-COVID: The 2020 pandemic created the sharpest economic contraction across all countries, with recovery patterns varying significantly by 2021-2022.
# Period analysis: Pre-crisis recovery, stable growth, COVID, recovery
gdp_growth_periods <- gdp_growth %>%
mutate(period = case_when(
year >= 2010 & year <= 2013 ~ "Post-GFC Recovery (2010-2013)",
year >= 2014 & year <= 2019 ~ "Stable Growth (2014-2019)",
year >= 2020 & year <= 2022 ~ "COVID Period (2020-2022)",
year >= 2023 ~ "Post-COVID (2023+)"
)) %>%
filter(!is.na(period))
period_avg_growth <- gdp_growth_periods %>%
group_by(country, period) %>%
summarize(avg_growth = mean(value, na.rm = TRUE), .groups = "drop")
ggplot(period_avg_growth, aes(x = period, y = avg_growth, fill = country)) +
geom_bar(stat = "identity", position = "dodge") +
geom_hline(yintercept = 0, color = "black") +
labs(
title = "Average GDP Growth by Period",
subtitle = "Comparing performance across distinct economic phases",
x = "",
y = "Average GDP Growth (%)",
fill = "Country"
) +
theme_minimal(base_size = 12) +
theme(axis.text.x = element_text(angle = 45, hjust = 1),
legend.position = "right")
Period-Specific Observations:
Analysis Focus: Price Stability. Compare the average inflation rate over the period, highlighting divergence points (e.g., post-2021 energy crisis impact).
# Filter inflation data
inflation <- wb_data_clean %>%
filter(indicator_id == "FP.CPI.TOTL.ZG") %>%
drop_na(value)
# Create line plot
ggplot(inflation, aes(x = year, y = value, color = country, group = country)) +
geom_line(size = 1.2) +
geom_point(size = 2) +
geom_hline(yintercept = 2, linetype = "dashed", color = "red", alpha = 0.5) +
annotate("text", x = 2010, y = 2.5, label = "ECB Target: 2%", hjust = 0) +
labs(
title = "Inflation, Consumer Prices (Annual %)",
subtitle = "2010-Present",
x = "Year",
y = "Inflation Rate (%)",
color = "Country"
) +
theme_minimal(base_size = 12) +
theme(legend.position = "right")
# Summary statistics
inflation_summary <- inflation %>%
group_by(country) %>%
summarize(
`Avg Inflation` = mean(value, na.rm = TRUE),
`Min` = min(value, na.rm = TRUE),
`Max` = max(value, na.rm = TRUE),
`Recent (Latest Year)` = last(value)
) %>%
arrange(`Avg Inflation`)
kable(inflation_summary,
digits = 2,
caption = "Inflation Summary Statistics") %>%
kable_styling(bootstrap_options = c("striped", "hover", "condensed"))
| country | Avg Inflation | Min | Max | Recent (Latest Year) |
|---|---|---|---|---|
| Slovenia | 2.17 | -0.53 | 8.83 | 1.97 |
| Croatia | 2.33 | -1.12 | 10.78 | 2.97 |
| Austria | 2.80 | 0.89 | 8.55 | 2.94 |
| Slovak Republic | 3.11 | -0.52 | 12.77 | 2.76 |
| Romania | 4.37 | -1.54 | 13.80 | 5.72 |
| Hungary | 4.58 | -0.23 | 17.12 | 3.70 |
| Serbia | 5.24 | 1.12 | 12.37 | 4.67 |
| Ukraine | 11.82 | -0.24 | 48.70 | 6.50 |
# Highlight post-2021 energy crisis
inflation_recent <- inflation %>%
filter(year >= 2020)
ggplot(inflation_recent, aes(x = year, y = value, color = country, group = country)) +
geom_line(size = 1.5) +
geom_point(size = 3) +
geom_hline(yintercept = 2, linetype = "dashed", color = "darkgreen", size = 1) +
annotate("text", x = 2020.2, y = 2.5, label = "ECB Target: 2%", hjust = 0, color = "darkgreen") +
labs(
title = "Inflation Surge: 2020-Present",
subtitle = "Post-COVID energy crisis and supply chain disruptions",
x = "Year",
y = "Inflation Rate (%)",
color = "Country"
) +
theme_minimal(base_size = 12) +
theme(legend.position = "right")
# Years above 3% inflation (concerning threshold)
high_inflation_years <- inflation %>%
filter(value > 3) %>%
group_by(country) %>%
summarize(years_above_3pct = n()) %>%
arrange(desc(years_above_3pct))
kable(high_inflation_years,
col.names = c("Country", "Years with Inflation > 3%"),
caption = "Number of Years with High Inflation (>3%)") %>%
kable_styling(bootstrap_options = c("striped", "hover", "condensed"))
| Country | Years with Inflation > 3% |
|---|---|
| Ukraine | 12 |
| Romania | 10 |
| Hungary | 9 |
| Serbia | 9 |
| Slovak Republic | 5 |
| Austria | 3 |
| Croatia | 3 |
| Slovenia | 2 |
Key Insights:
Pre-2020 Stability: Most countries maintained relatively stable inflation close to the ECB’s 2% target during 2010-2019.
2021-2023 Surge: The post-COVID period saw dramatic inflation spikes across all countries, driven by:
Hungary’s Inflation Challenge: Hungary has experienced more persistent inflationary pressures compared to some neighbors, particularly in recent years, reflecting:
Policy Response: Countries with independent monetary policy (Serbia) vs. those pegged to Euro or EU-bound show different adjustment mechanisms.
Analysis Focus: Fiscal Consolidation. Compare the change in debt burden: (Recent Value - 2010 Value). Which countries successfully reduced their debt-to-GDP ratio, and which saw it increase?
# Filter debt data
debt <- wb_data_clean %>%
filter(indicator_id == "GC.DOD.TOTL.GD.ZS") %>%
drop_na(value)
# Create line plot
ggplot(debt, aes(x = year, y = value, color = country, group = country)) +
geom_line(size = 1.2) +
geom_point(size = 2) +
geom_hline(yintercept = 60, linetype = "dashed", color = "red", alpha = 0.5) +
annotate("text", x = 2010, y = 65, label = "EU Maastricht Limit: 60%", hjust = 0) +
labs(
title = "Central Government Debt (% of GDP)",
subtitle = "2010-Present",
x = "Year",
y = "Debt (% of GDP)",
color = "Country"
) +
theme_minimal(base_size = 12) +
theme(legend.position = "right")
# Summary statistics
debt_summary <- debt %>%
group_by(country) %>%
summarize(
`2010` = first(value[year == 2010], default = NA),
`Most Recent` = last(value),
`Change` = last(value) - first(value[year == 2010], default = NA),
`Avg Debt` = mean(value, na.rm = TRUE)
) %>%
arrange(desc(`Most Recent`))
kable(debt_summary,
digits = 2,
caption = "Central Government Debt Summary") %>%
kable_styling(bootstrap_options = c("striped", "hover", "condensed"))
| country | 2010 | Most Recent | Change | Avg Debt |
|---|---|---|---|---|
| Hungary | 81.45 | 75.30 | -6.15 | 90.05 |
| Ukraine | 28.87 | 58.72 | 29.85 | 50.89 |
Analysis Focus: External Attractiveness. Compare the overall trend and volatility in attracting foreign investment over the period.
# Filter FDI data
fdi <- wb_data_clean %>%
filter(indicator_id == "BX.KLT.DINV.WD.GD.ZS") %>%
drop_na(value)
# Create line plot
ggplot(fdi, aes(x = year, y = value, color = country, group = country)) +
geom_line(size = 1.2) +
geom_point(size = 2) +
labs(
title = "Foreign Direct Investment, Net Inflows (% of GDP)",
subtitle = "2010-Present",
x = "Year",
y = "FDI Net Inflows (% of GDP)",
color = "Country"
) +
theme_minimal(base_size = 12) +
theme(legend.position = "right")
# Summary statistics
fdi_summary <- fdi %>%
group_by(country) %>%
summarize(
`Avg FDI` = mean(value, na.rm = TRUE),
`Min` = min(value, na.rm = TRUE),
`Max` = max(value, na.rm = TRUE),
`SD` = sd(value, na.rm = TRUE)
) %>%
arrange(desc(`Avg FDI`))
kable(fdi_summary,
digits = 2,
caption = "FDI Net Inflows Summary Statistics") %>%
kable_styling(bootstrap_options = c("striped", "hover", "condensed"))
| country | Avg FDI | Min | Max | SD |
|---|---|---|---|---|
| Hungary | 9.38 | -40.11 | 105.64 | 37.92 |
| Serbia | 6.01 | 2.83 | 9.62 | 1.77 |
| Croatia | 3.66 | 0.96 | 7.43 | 1.89 |
| Ukraine | 2.69 | -0.22 | 4.57 | 1.74 |
| Romania | 2.48 | 1.23 | 4.11 | 0.86 |
| Slovenia | 2.29 | 0.07 | 4.05 | 1.34 |
| Slovak Republic | 2.24 | -1.06 | 5.45 | 1.96 |
| Austria | -0.47 | -7.24 | 5.36 | 3.86 |
Analysis Focus: Labor Market Health. Track the rate of job market recovery from 2010 onwards, comparing initial high rates (in some countries) to recent structural lows.
# Filter unemployment data
unemployment <- wb_data_clean %>%
filter(indicator_id == "SL.UEM.TOTL.ZS") %>%
drop_na(value)
# Create line plot
ggplot(unemployment, aes(x = year, y = value, color = country, group = country)) +
geom_line(size = 1.2) +
geom_point(size = 2) +
labs(
title = "Unemployment, Total (% of Total Labor Force)",
subtitle = "2010-Present",
x = "Year",
y = "Unemployment Rate (%)",
color = "Country"
) +
theme_minimal(base_size = 12) +
theme(legend.position = "right")
# Summary statistics
unemployment_summary <- unemployment %>%
group_by(country) %>%
summarize(
`2010` = first(value[year == 2010], default = NA),
`Most Recent` = last(value),
`Change` = last(value) - first(value[year == 2010], default = NA),
`Avg` = mean(value, na.rm = TRUE)
) %>%
arrange(`Most Recent`)
kable(unemployment_summary,
digits = 2,
caption = "Unemployment Rate Summary Statistics") %>%
kable_styling(bootstrap_options = c("striped", "hover", "condensed"))
| country | 2010 | Most Recent | Change | Avg |
|---|---|---|---|---|
| Slovenia | 7.24 | 3.36 | -3.88 | 6.52 |
| Hungary | 11.17 | 4.43 | -6.74 | 6.32 |
| Slovak Republic | 14.39 | 5.23 | -9.15 | 9.35 |
| Croatia | 11.62 | 5.24 | -6.38 | 10.98 |
| Romania | 6.96 | 5.38 | -1.58 | 5.85 |
| Austria | 4.88 | 5.44 | 0.56 | 5.32 |
| Serbia | 19.20 | 7.39 | -11.81 | 14.67 |
| Ukraine | 8.10 | 9.83 | 1.73 | 8.68 |
# Calculate convergence relative to Austria (high-income benchmark)
convergence_data <- gdp_pc %>%
select(country, year, value) %>%
pivot_wider(names_from = country, values_from = value) %>%
pivot_longer(cols = -c(year, Austria), names_to = "country", values_to = "gdp_pc") %>%
mutate(
gap_to_austria = (gdp_pc / Austria) * 100,
country = as.factor(country)
) %>%
filter(country != "Austria") %>%
drop_na()
ggplot(convergence_data, aes(x = year, y = gap_to_austria, color = country, group = country)) +
geom_line(size = 1.2) +
geom_point(size = 2) +
geom_hline(yintercept = 100, linetype = "dashed", color = "black") +
labs(
title = "GDP per Capita Convergence to Austria",
subtitle = "GDP per capita as % of Austria's level",
x = "Year",
y = "% of Austria's GDP per capita",
color = "Country"
) +
theme_minimal(base_size = 12) +
theme(legend.position = "right")
# Focus on 2020 COVID crisis
crisis_2020 <- gdp_growth %>%
filter(year %in% c(2019, 2020, 2021, 2022)) %>%
group_by(country) %>%
arrange(year) %>%
mutate(period = case_when(
year == 2019 ~ "Pre-COVID",
year == 2020 ~ "COVID",
year == 2021 ~ "Recovery",
year == 2022 ~ "Post-Recovery"
))
ggplot(crisis_2020, aes(x = period, y = value, fill = country)) +
geom_bar(stat = "identity", position = "dodge") +
geom_hline(yintercept = 0, linetype = "solid", color = "black") +
labs(
title = "COVID-19 Crisis Response: GDP Growth Comparison",
subtitle = "2019-2022 Performance",
x = "Period",
y = "GDP Growth (%)",
fill = "Country"
) +
theme_minimal(base_size = 12) +
theme(legend.position = "right")
# Create overall performance ranking
overall_performance <- wb_data_clean %>%
drop_na(value) %>%
group_by(country, indicator_id) %>%
summarize(avg_value = mean(value, na.rm = TRUE), .groups = "drop") %>%
pivot_wider(names_from = indicator_id, values_from = avg_value) %>%
rename(
`GDP pc PPP` = NY.GDP.PCAP.PP.CD,
`GDP Growth` = NY.GDP.MKTP.KD.ZG,
`Inflation` = FP.CPI.TOTL.ZG,
`Gov Debt` = GC.DOD.TOTL.GD.ZS,
`FDI` = BX.KLT.DINV.WD.GD.ZS,
`Unemployment` = SL.UEM.TOTL.ZS
)
kable(overall_performance,
digits = 2,
format.args = list(big.mark = ","),
caption = "Average Performance Across All Indicators (2010-Present)") %>%
kable_styling(bootstrap_options = c("striped", "hover", "condensed", "responsive")) %>%
scroll_box(width = "100%")
| country | FDI | Inflation | GDP Growth | GDP pc PPP | Unemployment | Gov Debt |
|---|---|---|---|---|---|---|
| Austria | -0.47 | 2.80 | 1.16 | 55,672.59 | 5.32 | NA |
| Croatia | 3.66 | 2.33 | 1.96 | 30,204.74 | 10.98 | NA |
| Hungary | 9.38 | 4.58 | 2.38 | 32,166.85 | 6.32 | 90.05 |
| Romania | 2.48 | 4.37 | 2.68 | 29,387.14 | 5.85 | NA |
| Serbia | 6.01 | 5.24 | 2.22 | 19,486.21 | 14.67 | NA |
| Slovak Republic | 2.24 | 3.11 | 2.56 | 33,163.90 | 9.35 | NA |
| Slovenia | 2.29 | 2.17 | 2.00 | 38,441.83 | 6.52 | NA |
| Ukraine | 2.69 | 11.82 | -1.28 | 12,799.87 | 8.68 | 50.89 |
Strengths:
# Calculate Hungary's ranking in each indicator
hungary_rankings <- wb_data_clean %>%
drop_na(value) %>%
group_by(indicator_id, year) %>%
mutate(rank = rank(-value, ties.method = "average")) %>%
filter(country == "Hungary") %>%
group_by(indicator_id) %>%
summarize(avg_rank = mean(rank, na.rm = TRUE)) %>%
arrange(avg_rank)
print("Hungary's average ranking across years (1 = best):")
## [1] "Hungary's average ranking across years (1 = best):"
print(hungary_rankings)
## # A tibble: 6 × 2
## indicator_id avg_rank
## <chr> <dbl>
## 1 GC.DOD.TOTL.GD.ZS 1
## 2 FP.CPI.TOTL.ZG 3.4
## 3 NY.GDP.PCAP.PP.CD 3.8
## 4 NY.GDP.MKTP.KD.ZG 4
## 5 BX.KLT.DINV.WD.GD.ZS 4.8
## 6 SL.UEM.TOTL.ZS 6.33
Areas for Improvement:
# Create Hungary-specific dashboard
hungary_data <- wb_data_clean %>%
filter(country == "Hungary") %>%
arrange(indicator_id, year)
# Normalize all indicators to 2010 = 100 for comparison
hungary_indexed <- hungary_data %>%
group_by(indicator_id) %>%
mutate(
value_2010 = first(value[year == 2010]),
indexed_value = (value / value_2010) * 100
) %>%
filter(!is.na(indexed_value))
# Plot indexed trends
ggplot(hungary_indexed, aes(x = year, y = indexed_value, color = indicator_id, group = indicator_id)) +
geom_line(size = 1.2) +
geom_hline(yintercept = 100, linetype = "dashed", color = "black") +
labs(
title = "Hungary: All Economic Indicators Indexed to 2010 Baseline",
subtitle = "2010 = 100 for all indicators",
x = "Year",
y = "Index (2010 = 100)",
color = "Indicator"
) +
theme_minimal(base_size = 12) +
theme(legend.position = "bottom")
# Compare Hungary to different peer groups
peer_comparison <- wb_data_clean %>%
mutate(
peer_group = case_when(
country == "Hungary" ~ "Hungary",
country == "Austria" ~ "High-Income Benchmark",
country %in% c("Slovakia", "Slovenia", "Croatia") ~ "Advanced CEE",
country %in% c("Romania", "Serbia") ~ "Emerging CEE",
country == "Ukraine" ~ "Ukraine (Conflict-Affected)",
TRUE ~ "Other"
)
) %>%
filter(peer_group != "Other") %>%
group_by(peer_group, indicator_id, year) %>%
summarize(avg_value = mean(value, na.rm = TRUE), .groups = "drop")
# Focus on GDP per capita comparison
gdp_pc_peer <- peer_comparison %>%
filter(indicator_id == "NY.GDP.PCAP.PP.CD")
ggplot(gdp_pc_peer, aes(x = year, y = avg_value, color = peer_group, group = peer_group)) +
geom_line(size = 1.3) +
geom_point(size = 2) +
scale_y_continuous(labels = scales::dollar_format()) +
scale_color_manual(values = c(
"Hungary" = "red",
"High-Income Benchmark" = "darkgreen",
"Advanced CEE" = "steelblue",
"Emerging CEE" = "orange",
"Ukraine (Conflict-Affected)" = "purple"
)) +
labs(
title = "Hungary vs. Peer Group Comparisons: GDP per Capita (PPP)",
subtitle = "How does Hungary compare to different reference groups?",
x = "Year",
y = "GDP per capita (PPP)",
color = "Peer Group"
) +
theme_minimal(base_size = 12) +
theme(legend.position = "bottom")
Peer Group Analysis:
# Calculate Hungary's percentile ranking in each indicator
hungary_rankings_detailed <- wb_data_clean %>%
group_by(indicator_id, year) %>%
mutate(
percentile = (rank(value) - 1) / (n() - 1) * 100,
is_hungary = country == "Hungary"
) %>%
filter(is_hungary) %>%
group_by(indicator_id) %>%
summarize(
avg_percentile = mean(percentile, na.rm = TRUE),
recent_percentile = last(percentile),
trend = recent_percentile - first(percentile)
) %>%
arrange(desc(avg_percentile))
# Add indicator names
indicator_names <- data.frame(
indicator_id = c("NY.GDP.PCAP.PP.CD", "NY.GDP.MKTP.KD.ZG", "FP.CPI.TOTL.ZG",
"GC.DOD.TOTL.GD.ZS", "BX.KLT.DINV.WD.GD.ZS", "SL.UEM.TOTL.ZS"),
indicator_name = c("GDP per Capita", "GDP Growth", "Inflation (lower better)",
"Government Debt (lower better)", "FDI Inflows", "Unemployment (lower better)")
)
hungary_rankings_detailed <- hungary_rankings_detailed %>%
left_join(indicator_names, by = "indicator_id")
kable(hungary_rankings_detailed %>% select(indicator_name, avg_percentile, recent_percentile, trend),
digits = 1,
col.names = c("Indicator", "Avg Percentile", "Recent Percentile", "Trend"),
caption = "Hungary's Competitive Position (0 = worst, 100 = best among 8 countries)") %>%
kable_styling(bootstrap_options = c("striped", "hover", "condensed"))
| Indicator | Avg Percentile | Recent Percentile | Trend |
|---|---|---|---|
| Government Debt (lower better) | 100.0 | NaN | NaN |
| Inflation (lower better) | 65.7 | 57.1 | 0.0 |
| GDP per Capita | 60.0 | 42.9 | -14.3 |
| GDP Growth | 57.1 | 14.3 | -14.3 |
| FDI Inflows | 45.7 | 0.0 | 0.0 |
| Unemployment (lower better) | 21.3 | 16.7 | -40.5 |
Key Strengths:
Labor Market Performance: Hungary has achieved relatively low unemployment rates, particularly in recent years, indicating effective labor market policies and strong labor demand.
FDI Attraction: Hungary has been successful in attracting foreign direct investment, particularly in manufacturing sectors (automotive, electronics).
GDP Growth Resilience: While not the highest growth rate, Hungary has maintained consistent positive growth with moderate volatility.
Areas Requiring Attention:
Inflation Management: Hungary faces persistent challenges in controlling inflation compared to regional peers, requiring continued monetary policy vigilance.
Living Standards Gap: While growing, Hungary’s GDP per capita still lags behind the most advanced CEE economies.
Fiscal Sustainability: Government debt levels require careful management to maintain fiscal space for future crises.
Priority: Inflation Control
Hungary’s recent inflation experience suggests the need for: - Continued tight monetary policy coordination - Structural reforms to reduce energy vulnerability - Supply-side measures to enhance productivity and reduce cost-push inflation
Priority: Productivity Growth
To accelerate convergence with high-income peers: - Investment in human capital and education - R&D and innovation support - Digital transformation across sectors - Infrastructure modernization
Priority: Debt Management
Maintaining fiscal discipline while supporting growth: - Gradual fiscal consolidation during growth periods - Building buffers for future crises - Improving efficiency of public spending - Tax system optimization to balance revenue needs with competitiveness
Priority: Maintaining FDI Attractiveness
Hungary’s FDI success should be preserved through: - Stable and predictable business environment - Continued investment in infrastructure - Skills development aligned with investor needs - Integration into European value chains
Hungary’s economic development must be understood within the broader Central and Eastern European context:
EU Integration Benefits: Access to single market, structural funds, and institutional frameworks has been crucial for all CEE countries.
Diversification Challenge: Reducing dependence on single markets or energy sources remains a regional priority, made more urgent by recent geopolitical tensions.
Demographic Pressures: Like many CEE countries, Hungary faces aging population challenges that will affect long-term growth potential.
Technology and Innovation Gap: Transitioning from cost-competitive manufacturing to higher value-added activities is a shared regional challenge.
# Project simple trend continuation (illustrative only)
# Using last 5 years of Hungary GDP per capita data
hungary_gdp_recent <- gdp_pc %>%
filter(country == "Hungary", year >= max(year) - 5)
# Linear model for trend
if (nrow(hungary_gdp_recent) >= 3) {
model <- lm(value ~ year, data = hungary_gdp_recent)
# Project 5 years forward
future_years <- data.frame(year = (max(hungary_gdp_recent$year) + 1):(max(hungary_gdp_recent$year) + 5))
future_projection <- predict(model, newdata = future_years, interval = "confidence")
projection_data <- cbind(future_years, future_projection) %>%
mutate(type = "Projection")
historical_data <- hungary_gdp_recent %>%
mutate(fit = value, lwr = value, upr = value, type = "Historical")
combined_data <- bind_rows(
historical_data %>% select(year, fit, lwr, upr, type),
projection_data
)
ggplot(combined_data, aes(x = year, y = fit)) +
geom_line(aes(color = type), size = 1.2) +
geom_ribbon(data = projection_data, aes(ymin = lwr, ymax = upr), alpha = 0.2, fill = "blue") +
geom_point(data = historical_data, size = 3) +
scale_y_continuous(labels = scales::dollar_format()) +
scale_color_manual(values = c("Historical" = "red", "Projection" = "blue")) +
labs(
title = "Hungary GDP per Capita: Simple Trend Projection",
subtitle = "Based on 2019-present trend (for illustrative purposes only)",
x = "Year",
y = "GDP per capita (PPP)",
color = ""
) +
theme_minimal(base_size = 12)
}
Scenario Planning:
Baseline Scenario (Most Likely): Continued moderate growth (2-4% annually), gradual inflation normalization, stable FDI inflows. Hungary continues slow convergence with Western European living standards.
Optimistic Scenario: Structural reforms boost productivity, successful energy diversification, stronger EU integration. Growth accelerates to 4-5%, faster convergence trajectory.
Pessimistic Scenario: Prolonged inflation, reduced FDI, geopolitical tensions escalate. Growth slows to 0-2%, convergence stalls or reverses.
Over the 2010-present period, Hungary has demonstrated:
Achievements: - ✓ Consistent positive economic growth averaging above regional mean - ✓ Successful labor market integration with unemployment declining to low levels - ✓ Maintained attractiveness for foreign direct investment - ✓ Recovered effectively from the COVID-19 shock - ✓ Steady improvement in living standards (GDP per capita growth)
Challenges: - ✗ Persistent inflation pressures above regional average - ✗ Slower convergence rate compared to top CEE performers (Slovakia, Slovenia) - ✗ Moderate government debt levels requiring continued fiscal vigilance - ✗ Vulnerability to external shocks (energy, geopolitical)
Among its eight-country peer group (including Austria and six CEE neighbors), Hungary occupies a middle-tier position:
Inflation Management: Bringing inflation sustainably below 3% is crucial for maintaining competitiveness and purchasing power.
Productivity Enhancement: Shifting from quantity to quality of growth through innovation, education, and structural reforms.
Fiscal Discipline: Maintaining debt sustainability while preserving capacity for counter-cyclical policy.
Energy Security: Diversifying energy sources to reduce vulnerability and cost pressures.
EU Integration: Maximizing benefits from EU membership while maintaining policy flexibility where appropriate.
Hungary’s economic trajectory from 2010-present reflects a moderately successful development story within the Central European context. The country has achieved tangible improvements in living standards, maintained macroeconomic stability through major global shocks, and preserved its attractiveness as an investment destination.
However, accelerating convergence with high-income peers will require sustained policy focus on productivity growth, innovation, human capital development, and macroeconomic stability. The post-COVID period presents both challenges (inflation, geopolitical tensions) and opportunities (EU recovery funds, digital transformation, green transition) that will shape Hungary’s economic future in the coming decade.
The comparative analysis reveals that Hungary’s performance is neither exceptional nor problematic—it represents a steady, middle-of-the-pack trajectory that, with appropriate policy choices, could shift toward the higher-growth, faster-convergence path demonstrated by neighbors like Slovakia and Slovenia in earlier periods.
Data Source: World Bank Development Indicators (WDI) Analysis Period: 2010-Present Generated: 2025-11-13 Methodology: Longitudinal comparison using PPP-adjusted figures for cross-country comparability